<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<link href="<s:url value="/view/common_view/css/bootstrap.css"/>" rel="stylesheet" type="text/css" />
<link href="<s:url value="view/common_view/css/bootstrap.min.css"/>" rel="stylesheet" type="text/css" />	
<script type="text/javascript"  src="<s:url value="/view/common_view/js/bootstrap.js"/>"></script>
<script type="text/javascript"  src="<s:url value="/view/common_view/js/bootstrap.min.js"/>"></script>

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<link href="<s:url value="/view/common_view/css/bootstrap.css"/>" rel="stylesheet" type="text/css" />
<link href="<s:url value="/view/common_view/css/bootstrap.min.css"/>" rel="stylesheet" type="text/css" />


<script>
 $(function() {
   $( document ).tooltip({
     position: {
       my: "center bottom-12",
       at: "center top",
       using: function( position, feedback ) {
         $( this ).css( position );
         $( "<div>" )
           .addClass( "arrow" )
           .addClass( feedback.vertical )
           .addClass( feedback.horizontal )
           .appendTo( this );
       }
     }
   });
 });
</script>

<script type="text/javascript">
	function show_deal_list_by_city(){
		var formSubmit = document.getElementById("cityList");
		formSubmit.action = "show-deal-list-by-city.html";
		formSubmit.submit();
	}
</script>


<script type="text/javascript">
	$(document).ready(function(){
		$(".carousel'").carousel({interval: 2000});
	}
</script>

<script type="text/javascript">
$(document).ready(function() {
	var statusLO = false;
      $(".btnlogout").click(function() {
          if(statusLO == false){
          	$("#dialog-logout-confirm").slideToggle(100);
          	 $(".btnlogout").css({"color":"yellow", "font-size":"19"});
    		 $(".btnHomeURL").css({"color":"white", "font-size":"17"});
    		 $(".btninfoURL").css({"color":"white", "font-size":"17"});
    		 $(".btnChangepassURL").css({"color":"white", "font-size":"17"});
    		 $(".btnHistoryURL").css({"color":"white", "font-size":"17"});
    		 $(".btnFavoriteURL").css({"color":"white", "font-size":"17"});
    		 $(".btnWelcomeURL").css({"color":"white", "font-size":"17"});
          	statusLO = true;
          }
        });
      
      $('#btnHuyDX').click(function(){
    	  $("#dialog-logout-confirm").slideToggle(100);
    	  statusLO = false;
      });
});
</script>

<script type="text/javascript">
$(document).ready(function() {
	var urlTempC = document.URL;
	if(urlTempC.indexOf("home.html") > 0){
		 $(".btnHomeURL").css({"color":"yellow", "font-size":"19"});
		 $(".btninfoURL").css({"color":"white", "font-size":"17"});
		 $(".btnHistoryURL").css({"color":"white", "font-size":"17"});
		 $(".btnChangepassURL").css({"color":"white", "font-size":"17"});
		 $(".btnFavoriteURL").css({"color":"white", "font-size":"17"});
		 $(".btnlogout").css({"color":"white", "font-size":"17"});
		 $(".btnWelcomeURL").css({"color":"white", "font-size":"17"});
	}
	if(urlTempC.indexOf("getConsumerbyId2.html") > 0){
		 $(".btnWelcomeURL").css({"color":"yellow", "font-size":"19"});
		 $(".btnHomeURL").css({"color":"white", "font-size":"17"});
		 $(".btninfoURL").css({"color":"white", "font-size":"17"});
		 $(".btnChangepassURL").css({"color":"white", "font-size":"17"});
		 $(".btnHistoryURL").css({"color":"white", "font-size":"17"});
		 $(".btnlogout").css({"color":"white", "font-size":"17"});
		 $(".btnFavoriteURL").css({"color":"white", "font-size":"17"});
	 }
	if(urlTempC.indexOf("getConsumerId.html") > 0){
		 $(".btnChangepassURL").css({"color":"yellow", "font-size":"19"});
		 $(".btnHomeURL").css({"color":"white", "font-size":"17"});
		 $(".btninfoURL").css({"color":"white", "font-size":"17"});
		 $(".btnWelcomeURL").css({"color":"white", "font-size":"17"});
		 $(".btnHistoryURL").css({"color":"white", "font-size":"17"});
		 $(".btnlogout").css({"color":"white", "font-size":"17"});
		 $(".btnFavoriteURL").css({"color":"white", "font-size":"17"});
	}
	if(urlTempC.indexOf("favorite-deal.html") > 0){
		 $(".btnFavoriteURL").css({"color":"yellow", "font-size":"19"});
		 $(".btnHomeURL").css({"color":"white", "font-size":"17"});
		 $(".btninfoURL").css({"color":"white", "font-size":"17"});
		 $(".btnChangepassURL").css({"color":"white", "font-size":"17"});
		 $(".btnHistoryURL").css({"color":"white", "font-size":"17"});
		 $(".btnlogout").css({"color":"white", "font-size":"17"});
		 $(".btnWelcomeURL").css({"color":"white", "font-size":"17"});
	 }
	if(urlTempC.indexOf("order-history.html") > 0){
		$(".btnHistoryURL").css({"color":"yellow", "font-size":"19"});
		 $(".btnHomeURL").css({"color":"white", "font-size":"17"});
		 $(".btninfoURL").css({"color":"white", "font-size":"17"});
		 $(".btnChangepassURL").css({"color":"white", "font-size":"17"});
		 $(".btnFavoriteURL").css({"color":"white", "font-size":"17"});
		 $(".btnlogout").css({"color":"white", "font-size":"17"});
		 $(".btnWelcomeURL").css({"color":"white", "font-size":"17"});
	}
	
	if(urlTempC.indexOf("cungdeal-info.html") > 0){
		 $(".btninfoURL").css({"color":"yellow", "font-size":"19"});
		 $(".btnHomeURL").css({"color":"white", "font-size":"17"});
		 $(".btnHistoryURL").css({"color":"white", "font-size":"17"});
		 $(".btnChangepassURL").css({"color":"white", "font-size":"17"});
		 $(".btnFavoriteURL").css({"color":"white", "font-size":"17"});
		 $(".btnlogout").css({"color":"white", "font-size":"17"});
		 $(".btnWelcomeURL").css({"color":"white", "font-size":"17"});
	}
});
</script>

<!-- ===================================LOGOUT FORM ========================================  -->
<div id="dialog-logout-confirm" title="Xác nhận"
	style="height: 80px; display: none; border: 2px solid darkturquoise; border-radius: 10px 10px 10px 10px; padding-top: 25px;">
	<s:form method="post" action="logout-action">
		<p>
			Bạn có muốn đăng xuất hệ thống?  
		</p>
		<button type="submit" class="btn btn-success" title="Nhấn để đăng xuất"><s:property value="getText('button.dongy')"/></button>
		<button type="button" id="btnHuyDX" class="btn btn-warning" title="Nhấn để hủy đăng xuất"><s:property value="getText('button.huy')"/></button>
	</s:form>
</div>
<div id="header">
	<!-- ===================================TOP HEADER ========================================  -->
	<div id="topheader">
		<s:if test="#session == null || (#session != null && #session.master_user == null)">
			<div id="register">
				<a href="register-type.html" class="btnRegisterTypeURL" title="Nhấn để đăng kí tài khoản"><s:property value="getText('label.register')" /></a>
			</div>
			<div id="login">
				<a href="login.html" title="Nhấn để đăng nhập hệ thống"><s:property value="getText('label.login')" /> </a>
			</div>
		</s:if>
		
		<s:if test="#session != null && (#session.master_user != null)">
			<div id="logout" class="logout" >
				<a class="btnlogout" href="#" title="Nhấn để đăng xuất"><s:property value="getText('label.logout')" /></a>
			</div>
			<div id="welcome">
				<a class="btnWelcomeURL" href="getConsumerbyId2.html" title="Nhấn để xem thông tin chi tiết tài khoản"><s:property value="getText('label.xinchao')" />:<s:property value="#session.master_user.fullName"/></a>
			</div>
			<div id="changepass">
				<a class="btnChangepassURL" href="getConsumerId.html" title="Nhấn để thay đổi mật khẩu"><s:property value="getText('label.changepass')" /></a>
			</div>
		</s:if>
	</div>
	
	<!-- ===================================BACK GROUND ========================================  -->
	<div id="banner">
		<div id="myCarousel" class="carousel slide">
			<ol class="carousel-indicators">
				<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
			    <li data-target="#myCarousel" data-slide-to="1"></li>
			    <li data-target="#myCarousel" data-slide-to="2"></li>
			    <li data-target="#myCarousel" data-slide-to="3"></li>
			    <li data-target="#myCarousel" data-slide-to="4"></li>
			    <li data-target="#myCarousel" data-slide-to="5"></li>
			    <li data-target="#myCarousel" data-slide-to="6"></li>
			    <li data-target="#myCarousel" data-slide-to="7"></li>
			</ol>
	  		<!-- Carousel items -->
			<div class="carousel-inner">
			    <div class="active item">
			  		<img src="/CungDeal/view/common_view/images/banner.png"  alt="banner" width="1001" height="220" />
				</div>
			    <div class="item">
					 <img src="/CungDeal/view/common_view/images/banner2.jpg" alt="banner2" width="1001" height="220" />
				</div>
				<div class="item">
					 <img src="/CungDeal/view/common_view/images/banner3.jpg" alt="banner2" width="1001" height="220" />
				</div>
				<div class="item">
					 <img src="/CungDeal/view/common_view/images/banner4.jpg" alt="banner2" width="1001" height="220" />
				</div>
				<div class="item">
					 <img src="/CungDeal/view/common_view/images/banner5.jpg" alt="banner2" width="1001" height="220" />
				</div>
				<div class="item">
					 <img src="/CungDeal/view/common_view/images/banner6.jpg" alt="banner2" width="1001" height="220" />
				</div>
				<div class="item">
					 <img src="/CungDeal/view/common_view/images/banner7.jpg" alt="banner2" width="1001" height="220" />
				</div>
			</div>
			<!-- Carousel nav -->
			  <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
			  <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
		</div>
	</div>
	
	<!-- ===================================MENU ========================================  -->
	<div id="menu">
		<ul class="hmenu">
			<li class="homepage"><a class="btnHomeURL" href="home.html" title="Nhấn để về trang chủ"><s:property value="getText('label.trangchu')" /></a></li>
			<s:if test="#session != null && (#session.master_user != null)">
				<li><a class="btnFavoriteURL" href="favorite-deal.html" title="Nhấn để xem danh sách deal yêu thích"><s:property value="getText('label.dealyeuthich')" /></a></li>
				<li> <a class="btnHistoryURL" href="order-history.html" title="Nhấn để xem lịch sử đặt deal"><s:property value="getText('label.lichsudatdeal')" /></a></li>
			</s:if>
			<li><a class="btninfoURL" href="cungdeal-info.html" title="Nhấn để xem thông tin website"><s:property value="getText('label.thongtinchung')" /></a></li>
		</ul>
	</div>
	
	<!-- ===================================HOME BUTTON ========================================  -->
	<div id="homebuton" class="homebutton">
		<div class="homeimage"></div>
	</div>
	
	
	
	<!-- ===================================COMBOBOX ========================================  -->
	<div class="combobox">
		<div id="language">
			<form action="" id="languageForm">
				<script type="text/javascript">
					var urlTemp = document.URL;
					var urlLang = urlTemp;
					var position1 = urlTemp.indexOf("?request_locale");
					var position2 = urlTemp.indexOf("&request_locale");

					if(position1 == -1 && position2 == -1) {
						position1 = urlTemp.indexOf("?");
						if(position1 == -1){
							urlLang = urlTemp+"?request_locale";
						}
						else{
							urlLang = urlTemp+"&request_locale";
						}
					}
					else {
						if(position1 > -1){
							urlLang = urlTemp.substr(0,position1)+"?request_locale";
						}
						if(position2 > -1){
							urlLang = urlTemp.substr(0,position2)+"&request_locale";
						}
					}
					document.write('<a href="'+urlLang+'=vi" title="Nhấn để chọn ngôn ngữ tiếng Việt">');			
					document.write('<div class="dd-vietnamese"></div>');
					document.write('</a>');
					
					document.write('<a href="'+urlLang+'=en" title="Nhấn để chọn ngôn ngữ tiếng Anh">');
					document.write('<div class="dd-english"></div>');
					document.write('</a>');
				</script>
			</form>
		</div>
		<div id="city">
			<s:form action="" id="cityList">
				<s:select id="thanhpho" class="thanhpho" headerValue="HỒ CHÍ MINH" headerKey="2"
					list="city2" 
					value="citySelected2"
					name="citySelected2"
					onchange="show_deal_list_by_city();"
					listKey="cityID"
					listValue="cityName" 
					style="width: 170px;">
				</s:select>
			</s:form>
 		</div>
	</div>
</div>